<?php
class PNAjaxBrandArray extends PNObjectExArray {
  function PNAjaxBrandArray($init=null, $where='')
  {
    $this->PNObject();

    $this->_objType       = 'innoforum_brand';
    $this->_objField      = 'id';
    $this->_objPath       = 'form';

    $this->_init($init, $where);
  }

  function genSort(){
    return " ORDER BY bra_name ASC";
  }

  function genFilter(){
    $subcategory_id  = FormUtil::getPassedValue ('subcategory_id', false);

    $wheres = array();

    //filter by selector
    if ($subcategory_id && intval($subcategory_id))
      $wheres[] = "bra_subcategory_id ='$subcategory_id'";

    return implode(' AND ', $wheres) ;
  }

}